/*
 * Copyright (c) 2019-2020, NVIDIA CORPORATION.  All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __GST_DSDIRECTION_H__
#define __GST_DSDIRECTION_H__

#include <gst/base/gstbasetransform.h>
#include <gst/video/video.h>

#include "gstnvdsmeta.h"
#include "dsdirection_lib/dsdirection_lib.h"

/* Package and library details required for plugin_init */
#define PACKAGE "dsdirection"
#define VERSION "1.0"
#define LICENSE "Proprietary"
#define DESCRIPTION "NVIDIA dsdirection plugin for integration with DeepStream"
#define BINARY_PACKAGE "NVIDIA DeepStream 3rdparty IP integration dsdirection plugin"
#define URL "http://nvidia.com/"


G_BEGIN_DECLS
/* Standard boilerplate stuff */
typedef struct _GstDsDirection GstDsDirection;
typedef struct _GstDsDirectionClass GstDsDirectionClass;

/* Standard boilerplate stuff */
#define GST_TYPE_DSDIRECTION (gst_dsdirection_get_type())
#define GST_DSDIRECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DSDIRECTION,GstDsDirection))
#define GST_DSDIRECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DSDIRECTION,GstDsDirectionClass))
#define GST_DSDIRECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_DSDIRECTION, GstDsDirectionClass))
#define GST_IS_DSDIRECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DSDIRECTION))
#define GST_IS_DSDIRECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DSDIRECTION))
#define GST_DSDIRECTION_CAST(obj)  ((GstDsDirection *)(obj))

struct _GstDsDirection
{
  GstBaseTransform base_trans;

  // Unique ID of the element. The labels generated by the element will be
  // updated at index `unique_id` of attr_info array in NvDsObjectParams.
  guint unique_id;

  // Frame number of the current input buffer
  guint64 frame_num;

  // Input video info (resolution, color format, framerate, etc)
  GstVideoInfo video_info;

  // Amount of objects processed in single call to algorithm
  guint batch_size;

  // GPU ID on which we expect to execute the task
  guint gpu_id;

};

// Boiler plate stuff
struct _GstDsDirectionClass
{
  GstBaseTransformClass parent_class;
};

GType gst_dsdirection_get_type (void);

G_END_DECLS
#endif /* __GST_DSDIRECTION_H__ */
